//
//  GNRHelper.h
//  UUIM
//
//  Created by LvYuan on 2017/4/5.
//  Copyright © 2017年 UUPaotui. All rights reserved.
//

#import "GNRObject.h"
#import <UIKit/UIKit.h>

@interface GNRHelper : GNRObject
@property (nonatomic, copy) void(^alterAffireAction)();
+ (void)goCheckSetting;
+ (GNRHelper *)gNRHelpShare;

+ (void)userDefault:(NSString *)object key:(NSString *)key;
+ (id)getUserObjectKey:(id)key;

+ (NSString*)dictionaryToJson:(NSDictionary *)dic;
+ (void)goCheckSetting;
/*!
 * @brief 把格式化的JSON格式的字符串转换成obj
 * @param jsonString JSON格式的字符串
 * @return 返回obj
 */
+ (id)objWithJsonString:(NSString *)jsonString;
+ (NSString *)device;
+ (NSString *)appVersion;//版本 1.0
+ (NSString *)getAppVersionDesc;//版本的描述 v1.0(99)
+ (NSString *)getUrlWithBaseUrl:(NSString *)baseUrl parameters:(NSDictionary *)parameters;

//两个日期的比较
+ (NSComparisonResult)compareOneDay:(NSString *)oneDay withAnotherDay:(NSString *)anotherDay;
//日期校验
+ (BOOL)isValidDateStr:(NSString *)dateStr;
+ (NSString*)showDetailTime:(NSTimeInterval) msglastTime;
+ (NSString*)showTime:(NSTimeInterval) msglastTime showDetail:(BOOL)showDetail;
+ (NSString*)standardTime:(NSDate*)date;//yyyy-MM-dd HH:mm:ss
+ (NSString*)standardTimeForFile:(NSDate*)date;//yyyy-MM-dd_HH:mm:ss
+ (NSString*)getCurrentTime:(NSDate*)date dateFormate:(NSString *)dateFormate;//自定义时间
+ (NSString*)standardDateForFile:(NSDate*)date;

//时间戳-字符串日期
+ (NSString*)dateFormatForTime:(NSTimeInterval)time;
//时间戳-时间XX:XX:XX
+ (NSString*)timeStrFormatForTime:(NSTimeInterval)time;

//保存图片到本地并获取图片路径
+ (NSString *)filePathWithImageData:(NSData *)data type:(NSString *)type;

+ (NSString *)valueFromUrl:(NSString *)url param:(NSString *)paramName;
//url - dictionary
+ (NSDictionary*)dictionaryFromQuery:(NSString*)query usingEncoding:(NSStringEncoding)encoding;
/**
 将带有 {}
 @param str 替换为富文本
 @return attstring
 */
+ (NSAttributedString *)replaceBracketsFromString:(NSString *)str textColor:(UIColor *)textColor fontSize:(CGFloat)fontSize;

/**
 将带有 {} 替换为富文本
 */
+ (NSAttributedString *)replaceBracketsFromString:(NSString *)str textColor:(UIColor *)textColor font:(UIFont *)font lineSpace:(CGFloat)lineSpace;

//是否有下划线
+ (NSAttributedString *)replaceBracketsFromString:(NSString *)str textColor:(UIColor *)textColor font:(UIFont *)font hasLine:(BOOL)hasLine;

+ (BOOL)isUrl:(NSString *)url;
+ (BOOL)isMobileNumber:(NSString *)mobileNum;
+ (BOOL)uIsAvailablePassword:(NSString *)password;
+ (UIImage *)imageCompressForSize:(UIImage *)sourceImage targetSize:(CGSize)size;

//显示
+ (void)showAlertViewController:(UIViewController *)viewController title:(NSString *)title  cancelTitle:(NSString *)canceltitle affireTitle:(NSString *)affireTitle affireAction:(void(^)())affireAction;

@end
